# default target "all" builds the executable file 'runmaze' and the
all : main

# add any new .o files to the list
# build it using g++
main : main.o HeapPQueue.o Triangle.o Point.o Edge.o Triangulator.o Maze.o Mazeprinter.o PoissonDisks.o PathCreator.o DisjointSets.o
	g++ -o aMAZEing -g main.o HeapPQueue.o Triangle.o Point.o Edge.o Triangulator.o Maze.o Mazeprinter.o PoissonDisks.o PathCreator.o DisjointSets.o
# runmaze.o is dependant on one .cpp file, and several .h files
# IMPORTANT: when you #include a new .h file, be sure to add it here.  Otherwise, the 'make' command may not re-build your program even though you changed a file.
# -Wall: make the compiler display all warnings it knows about; hopefully it'll catch something for us
# -c: only compile, don't link (we do that above)
# -g: put in debug information, for those of you who are using debuggers (like gdb or xxgdb)

main.o : main.cpp Triangle.h Triangulator.h Point.h Edge.h PoissonDisks.h Maze.h Mazeprinter.h DisjointSets.h
	g++ -Wall -c -g main.cpp

# and same idea for other .o files

PoissonDisks.o : PoissonDisks.cpp PoissonDisks.h Point.h
	g++ -Wall -c -g PoissonDisks.cpp 

HeapPQueue.o : HeapPQueue.cpp Compare.h PQueue.h HeapPQueue.h
	g++ -Wall -c -g HeapPQueue.cpp

Point.o : Point.cpp Point.h
	g++ -Wall -c -g Point.cpp
	
Triangle.o : Triangle.cpp Triangle.h Point.h
	g++ -Wall -c -g Triangle.cpp
	
Edge.o : Edge.cpp Edge.h Point.h
	g++ -Wall -c -g Edge.cpp
	
Triangulator.o : Triangulator.cpp Triangulator.h HeapPQueue.h Compare.h Point.h Triangle.h
	g++ -Wall -c -g Triangulator.cpp
	
Maze.o : Maze.cpp Maze.h Point.h Edge.h Mazeprinter.h Triangle.h Triangulator.h PoissonDisks.h
	g++ -Wall -c -g Maze.cpp
	
Mazeprinter.o : Mazeprinter.cpp Mazeprinter.h Point.h Edge.h Maze.h
	g++ -Wall -c -g Mazeprinter.cpp

PathCreator.o : PathCreator.cpp PathCreator.h DisjointSets.h Edge.h Compare.h
	g++ -Wall -c -g PathCreator.cpp

DisjointSets.o : DisjointSets.cpp DisjointSets.h Triangle.h
	g++ -Wall -c -g DisjointSets.cpp

# 'clean' removes any files that were created via the Makefile, leaving you with only your original source code files
clean :
	rm *.o
	rm aMAZEing

